﻿@using Abp.Collections.Extensions
@model Admin.Views.Shared.Components.LeftSideBar.LeftSideBarViewModel
<aside id="leftsidebar" class="sidebar">
    <div class="user-info">
        <div class="image">
            <img src="~/images/user.png" width="48" height="48" alt="User" />
        </div>
        <div class="info-container">
            <div class="name" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></div>
            <div class="email">jinghongbo@live.com</div>
            <div class="btn-group user-helper-dropdown">
                <i class="material-icons" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">keyboard_arrow_down</i>
                <ul class="dropdown-menu pull-right">
                    @*<li>
                            <a href="javascript:void(0);"><i class="material-icons">person</i>个人中心</a>
                        </li>
                        <li role="seperator" class="divider"></li>*@
                    <li>
                        <a asp-controller="User" asp-action="Logout"><i class="material-icons">input</i>注销</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <div class="menu">
        <ul class="list">
            @foreach (var menuItem in Model.MainMenu.Items)
            {
                <li class="@(Model.ActiveMenuItemName == menuItem.Name ? "active" : "")">
                    @if (menuItem.Items.IsNullOrEmpty())
                    {
                        <a href="@menuItem.Url">
                            @if (!string.IsNullOrWhiteSpace(menuItem.Icon))
                            {
                                <i class="material-icons">@menuItem.Icon</i>
                            }
                            <span>@menuItem.DisplayName</span>
                        </a>
                    }
                    else
                    {
                        <a href="javascript:void(0);" class="menu-toggle">
                            @if (!string.IsNullOrWhiteSpace(menuItem.Icon))
                            {
                                <i class="material-icons">@menuItem.Icon</i>
                            }
                            <span>@menuItem.DisplayName</span>
                        </a>
                        <ul class="ml-menu">
                            @foreach (var subMenuItem in menuItem.Items)
                            {
                                <li class="@(Model.ActiveMenuItemName == subMenuItem.Name ? "active" : "")">
                                    @if (subMenuItem.Items.IsNullOrEmpty())
                                    {
                                        <a href="@subMenuItem.Url">
                                            @if (!string.IsNullOrWhiteSpace(subMenuItem.Icon))
                                            {
                                                <i class="material-icons">@subMenuItem.Icon</i>
                                            }
                                            <span>@subMenuItem.DisplayName</span>
                                        </a>
                                    }
                                    else
                                    {
                                        <a href="javascript:void(0);" class="menu-toggle">
                                            @if (!string.IsNullOrWhiteSpace(subMenuItem.Icon))
                                            {
                                                <i class="material-icons">@subMenuItem.Icon</i>
                                            }
                                            <span>@subMenuItem.DisplayName</span>
                                        </a>
                                        <ul class="ml-menu">
                                            @foreach (var subSubMenuItem in subMenuItem.Items)
                                            {
                                                <li class="@(Model.ActiveMenuItemName == subSubMenuItem.Name ? "active" : "")">
                                                    <a href="@subSubMenuItem.Url">
                                                        @subSubMenuItem.DisplayName
                                                    </a>
                                                </li>
                                            }
                                        </ul>
                                    }
                                </li>
                            }
                        </ul>
                    }
                </li>
            }
        </ul>
    </div>
    <div class="legal">
        <div class="copyright">
            &copy; 2016 - 2017 <a href="javascript:void(0);">管理系统</a>.
        </div>
        <div class="version">
            <b>版本: </b> 0.0.1
        </div>
    </div>
</aside>

